package utils.path.support;

import utils.path.ConfigPath;
import utils.test.Assert;

public class JarConfigPath extends ConfigPath {

	public JarConfigPath(String locations) {
		super(locations);
	}
	
	public JarConfigPath(String[] locations) {
		super(locations);
	}

	private String getRootPath(){
		return this.getClass().getResource("").getPath();
	}
	
	@Override
	//TODO 未实现该加载方法
	public String[] processConfigPath() {
		Assert.isNotNull(this.locations, "配置路径不可为空");
		Assert.hasLength(this.locations, "配置路径不可为空");
		String rootPath = getRootPath();
		
		for (int i=0;i<this.locations.length;i++) {
			locations[i] = rootPath + locations[i];
		}
		return this.locations;
	}

	public static void main(String[] args) {
		JarConfigPath jfile = new JarConfigPath("aa.txt");
		jfile.processConfigPath();
	}
	
}
